﻿module Sustainalytics.Screening {

    export interface IScreeningToolFactory {
        getCurrentFilter: () => any;
        getCriteriaTabsAndTemplates: () => ng.IPromise<any>;

        addCriteriaTypeTwo: (criteriaTemplateId: string, score: number) => any;
        addCriteriaTypeOne: (criteriaTemplateId: string, minValue: number, maxValue: number) => any;
        loadCriteriaTypeTwo: (criteriaTemplateId: string) => any;
        loadCriteriaTypeOne: (criteriaTemplateId: string) => any;

        loadCriteriaTypeThree: (criteriaId: string, skip: number, take: number) => any;
        addCriteriaTypeThree: (criteriaTemplateId: string, selectedItems: Array<string>) => any;
        updateCriteriaTypeThree: (criteria: ICriteriaTypeThree) => any;
        getCriteriaTypeThreeCollectionItems: (criteriaId: string, filter: string, loadMore: boolean, skip: number, take: number) => any;

        addCriteriaTypeSix: (criteriaTemplateId: string, minValue: number, maxValue: number) => any;
        loadCriteriaTypeSix: (criteriaTemplateId: string) => any;
        updateCriteriaTypeSix: (criteriaId: string, minValue: number, maxValue: number) => any;

        addCriteriaTypeFive: (criteriaTemplateId: string, score: number, templateNumber: string) => any;
        loadCriteriaTypeFive: (criteriaId: string) => any;
        loadTemplateCriteriaTypeFive: (criteriaTemplateId: string) => any;
        composeAnswerTextCriteriaTypeFive: (array: any, score: number) => string;
        updateCriteriaTypeFive: (criteriaId: string, score: number, templateNumber: string) => any;

        loadCriteriaTypeSeven: (criteriaId: string, skip: number, take: number) => any;
        addCriteriaTypeSeven: (criteriaTemplateId: string, selectedItems: Array<string>) => any;
        updateCriteriaTypeSeven: (criteria: ICriteriaTypeThree) => any;
        getCriteriaTypeSevenCollectionItems: (criteriaId: string, filter: string, loadMore: boolean, skip: number, take: number) => any;

        getPortfolios: (filter, skip: number, take: number, orderBy: string) => any;
        updateSelectedCriteriaOrderNumber: (filterId: string, criteriaIds: Array<string>) => any;
        deleteCriteria: (criteriaId: string) => any;
        updateCriteriaTypeOne: (criteriaId: string, minValue: number, maxValue: number) => any;
        updateCriteriaTypeTwo: (criteriaId: string, score: number) => any;
        listBaseCriteria: () => ng.IPromise<IBaseCriteria[]>;

        runSelectedCriteria: (filterId: string, portfolioId: string) => ng.IHttpPromise<{}>;
        getResultOutput: (filter: ResultOutputFilter, skip: number, take: number, orderBy: string, asc: boolean) => any;
        deleteAllCriteria: (filterId: string) => any;
        deleteResultOutput: (filterId: string) => ng.IPromise<{}>;

        addCriteriaTypeEight: (criteriaTemplateId: string, score: number) => any;
        loadCriteriaTypeEight: (criteriaTemplateId: string) => any;
        updateCriteriaTypeEight: (criteriaId: string, score: number) => any;

        listLastUsedFilters: () => ng.IHttpPromise<any>;
        listUserFilters: () => ng.IHttpPromise<any>;
        saveFilter: (dto: ISaveFilterDto) => ng.IHttpPromise<any>;
        saveNewFilter: (dto: ISaveFilterDto) => ng.IHttpPromise<any>;
        loadSavedFilter: (rootFilterId: string) => ng.IHttpPromise<any>;

        exportCurrentCriteria: (exportDetails: ExportDetailsDto) => any;

        // Criteria Type 4 //
        deleteCriteriaTypeFour: (piFilterCriteriaId: string) => ng.IHttpPromise<any>;
        loadCriteriaTypeFour: (piFilterCriteriaId: string) => ng.IHttpPromise<any>;
        loadCriteriaTypeFourCategories: (symbol: string) => ng.IHttpPromise<any>;
        addCriteriaTypeFour: (criteriaTemplateId: string, piCategories: any) => any;

        loadStandardFilter(standardFilter: StandardFilter);
        loadUniverses: () => ng.IHttpPromise<{}>;
    }
}